import '@kangc/v-md-editor/lib/style/base-editor.css'
import createCopyCodePreview from '@kangc/v-md-editor/lib/plugins/copy-code/preview'
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js'
import '@kangc/v-md-editor/lib/theme/style/github.css'
import '@kangc/v-md-editor/lib/theme/style/vuepress.css'
import '@kangc/v-md-editor/lib/plugins/copy-code/copy-code.css'
import VMdPreview from '@kangc/v-md-editor/lib/preview'
import '@kangc/v-md-editor/lib/style/preview.css'
import createKatexPlugin from '@kangc/v-md-editor/lib/plugins/katex/cdn'
// 基础啊版
// import VueMarkdownEditor from '@kangc/v-md-editor'
// 进阶版
import VueMarkdownEditor from '@kangc/v-md-editor/lib/codemirror-editor'

import createCopyCodePlugin from '@kangc/v-md-editor/lib/plugins/copy-code/index'
import createLineNumbertPlugin from '@kangc/v-md-editor/lib/plugins/line-number/index'
import Prism from 'prismjs'
// CodeMirror5.X编辑器
import Codemirror from 'codemirror5'
// mode
import 'codemirror5/mode/markdown/markdown'
import 'codemirror5/mode/javascript/javascript'
import 'codemirror5/mode/css/css'
import 'codemirror5/mode/htmlmixed/htmlmixed'
import 'codemirror5/mode/vue/vue'
// edit
import 'codemirror5/addon/edit/closebrackets'
import 'codemirror5/addon/edit/closetag'
import 'codemirror5/addon/edit/matchbrackets'
// placeholder
import 'codemirror5/addon/display/placeholder'
// active-line
import 'codemirror5/addon/selection/active-line'
// scrollbar
import 'codemirror5/addon/scroll/simplescrollbars'
import 'codemirror5/addon/scroll/simplescrollbars.css'
// // style
import 'codemirror5/lib/codemirror.css'
import 'codemirror5/theme/monokai.css'
VMdPreview
  .use(
    vuepressTheme
  )
  .use(createKatexPlugin())
  .use(createCopyCodePlugin())
  .use(createLineNumbertPlugin())
VueMarkdownEditor.Codemirror = Codemirror
VueMarkdownEditor
  .use(vuepressTheme, {
    Prism,
    config: {
      toc: {
        includeLevel: [1, 2, 3, 4]
      }
    },
    extend () {
      // md为 markdown-it 实例，可以在此处进行修改配置,并使用 plugin 进行语法扩展
      // md.set(option).use(plugin);
    }
  })
  .use(createKatexPlugin())
  .use(createCopyCodePlugin())
  .use(createCopyCodePreview())
  .use(createLineNumbertPlugin())
export {
  VueMarkdownEditor,
  VMdPreview
}
